package com.example.kotlin_api.t

class MagicBox<T : Human> {
    inline fun <reified T> randomOrBackup(ob: (test: String) -> T): T {
        var items = listOf(Boy(2, "baby"), Boy(3, "baby2"), Human(22))
        val item = items.random()
        return if (item is T) {
            item
        } else {
            ob("no anyone")
        }
    }
}